﻿//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using System.Management.Instrumentation;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration.Manageability;

namespace EntLibContrib.Query.Configuration.Manageability.Queries
{
	/// <summary>
	/// Represents the configuration information for an instance of
	/// <see cref="EntLibContrib.Query.Configuration.ServiceQueryData"/>.
	/// </summary>
	/// <seealso cref="EntLibContrib.Query.Configuration.QueryData"/>
	/// <seealso cref="EntLibContrib.Query.Configuration.QueryDataBase"/>
	/// <seealso cref="NamedConfigurationSetting"/>
	/// <seealso cref="ConfigurationSetting"/>
	[ManagementEntity]
	public abstract class ServiceQuerySetting : QuerySetting
	{
		#region Fields
		private string address;
		private string service;
		private string method;
		#endregion

		#region Properties
		/// <summary>
		/// Gets or sets the service address.
		/// </summary>
		/// <value>The service address.</value>
		[ManagementConfiguration]
		public string Address
		{
			get { return address; }
			set { address = value; }
		}

		/// <summary>
		/// Gets or sets the service.
		/// </summary>
		/// <value>The service.</value>
		[ManagementConfiguration]
		public string Service
		{
			get { return service; }
			set { service = value; }
		}

		/// <summary>
		/// Gets or sets the method.
		/// </summary>
		/// <value>The method.</value>
		[ManagementConfiguration]
		public string Method
		{
			get { return method; }
			set { method = value; }
		}
		#endregion

		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ServiceQuerySetting"/> class.
		/// </summary>
		/// <param name="sourceElement">The source element.</param>
		/// <param name="name">The name.</param>
		/// <param name="customCommandName">Name of the custom command.</param>
		/// <param name="parameterSetName">Name of the parameter set.</param>
		/// <param name="address">The address.</param>
		/// <param name="service">The service.</param>
		/// <param name="method">The method.</param>
		protected ServiceQuerySetting(ServiceQueryData sourceElement,
																	string name, 
																	string customCommandName,
																	string parameterSetName,
																	string address,
																	string service,
																	string method)
			: base(sourceElement, name, customCommandName, parameterSetName)
		{
			this.address = address;
			this.service = service;
			this.method = method;
		}
		#endregion
	}
}
